#include <sstream>
#include "buram.h"
#include "buram_test.h"
#include "m01_buram.h"

namespace igslib
{
	IBuRAMManager* CBuRAMManager::instance = 0;
	IBuRAMManager* CBuRAMManager::GetInstance() 
	{
		if ( instance == 0 )
		{
			instance = new CBuRAMManager();
		}
		return instance ;
	}
    IBuRAM* CBuRAMManager::NewBuRAM()
    {
        IBuRAM* rtn = nullptr;
        try
        {
            rtn = new FileBuRAM();
            cpns.insert(rtn);
        }
        catch(const std::exception& e)
        {
        }
        return rtn;
    }
    IBuRAM* CBuRAMManager::NewM01BuRAM()
    {
        IBuRAM* rtn = nullptr;
        try
        {
            rtn = new m01_buram();
            cpns.insert(rtn);
        }
        catch(const std::exception& e)
        {
        }
        return rtn;
    }
}

extern "C"{
	igslib::IBuRAMManager* GetBuRAMManagerInstance()
	{
		return igslib::CBuRAMManager::GetInstance();
	}
}
